package com.xzakota.minesweeper.model.entity;

import java.io.Serial;
import java.io.Serializable;
import java.util.Objects;

/**
 * 游戏单个记录实体类
 *
 * @author Xzakota
 */
public class RecordBean implements Serializable {
    @Serial
    private static final long serialVersionUID = 1L;

    public int levelID;
    public String player;
    public int playTime;

    public RecordBean(int levelID, String name, int playTime) {
        this.levelID = levelID;
        this.player = name;
        this.playTime = playTime;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        RecordBean that = (RecordBean) o;
        return levelID == that.levelID && playTime == that.playTime && Objects.equals(player, that.player);
    }

    @Override
    public int hashCode() {
        return Objects.hash(levelID, player, playTime);
    }

    @Override
    public String toString() {
        return "RecordBean{" +
                "levelID=" + levelID +
                ", player='" + player + '\'' +
                ", playTime=" + playTime +
                '}';
    }
}
